package com.lmx.repoDomain.tmodel;

import io.katharsis.resource.annotations.JsonApiResource;
import io.katharsis.resource.annotations.JsonApiToOne;
import com.lmx.repoDomain.tmodel.business.User;//huibati;
import javax.persistence.*;

/**
 * 签到表
 */
@Entity
@Table(name = "ccd_sign")
@JsonApiResource(type = "sign")
public class Sign extends BaseEntity {
	private String code; // 编码
	private User user; //用户
	private Task task; //任务
	private Integer signTime; //签到时间
	private Short signType; //签到类型
	private String remark;//备注

	@Column(name = "code")
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	@JsonApiToOne
	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
	@JoinColumn(name = "user_id",foreignKey = @ForeignKey(name = "null"))
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@JsonApiToOne
	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
	@JoinColumn(name = "task_id",foreignKey = @ForeignKey(name = "null"))
	public Task getTask() {
		return task;
	}

	public void setTask(Task task) {
		this.task = task;
	}

	@Column(name = "sign_time")
	public Integer getSignTime() {
		return signTime;
	}

	public void setSignTime(Integer signTime) {
		this.signTime = signTime;
	}

	@Column(name = "sign_type")
	public Short getSignType() {
		return signType;
	}

	public void setSignType(Short signType) {
		this.signType = signType;
	}

	@Column(name = "remark")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}
}
